<template>
  <j-select-biz-component :width="1000" v-bind="configs" ref="JSelectBizComponent" v-on="$listeners"/>
</template>

<script>
  import JSelectBizComponent from './JSelectBizComponent'
  import { filterDictTextByCache } from '@/components/dict/JDictSelectUtil';
  export default {
    name: 'JSelectPosition',
    components: { JSelectBizComponent },
    props: ['value','selectTeacher'],
    data() {
      return {
        classId:null,
        settings: {
          name: '教师',
          displayKey: 'realname',
          returnKeys: ['id', 'id'],
          listUrl: '/management/teacher/list',
          queryParamCode: 'realname',
          queryParamText: '教师名称',
          columns: [
            { title: '教师姓名', dataIndex: 'realname', align: 'center', width: '30%', widthRight: '70%' },
            { title: '教师工号', dataIndex: 'workNo', align: 'center', width: '35%' },
            { title: '教师类型', dataIndex: 'teacherType', align: 'center', width: '25%' ,customRender: function(text) {
            return filterDictTextByCache('teacher_type', text)
          }},
            // { title: '联系电话', dataIndex: 'phone', align: 'center', width: '25%' },
          ]
        }
      }
    },
    computed: {
      configs() {
        return Object.assign({ value: this.value,selectTeacher:this.selectTeacher,classId:this.classId }, this.settings, this.$attrs)
      }
    },
    
    methods:{
      open(record){
        this.classId = record.id;
        this.$refs.JSelectBizComponent.openModel();
      }
    }
  }
</script>

<style lang="less" scoped></style>